/*
 * @Descripttion: donglyc
 * @version:
 * @Author: donglyc
 * @Date: 2021-01-05 14:11:03
 * @LastEditors: donglyc
 * @LastEditTime: 2021-01-15 14:33:22
 */
import request from '@/utils/request';

export const FILE_UPLOAD = '/sealCuttingApi/file/download/';

/**
 * 文件下载流的方式
 * @param params
 * @returns {AxiosPromise<any>}
 */
export async function downloadID(params: any) {
  return request(FILE_UPLOAD + params, {
    responseType: 'blob',
  });
}

/**
 * 作品图片文件下载接口
 * @param params
 */
export async function downloadWorksFile(params: any) {
  return request('/sealCuttingApi/file/downloadWorksFile/' + params, {
    responseType: 'blob',
  });
}

/**
 * 返回下载路径
 * @param id
 * @returns {string}
 */
export function getdownLoadUrl(id) {
  return FILE_UPLOAD + id;
}

/**
 * 获取文件信息
 * @param params
 */
export async function queryByIdFile(params: { id?: string }) {
  return request('/sealCuttingApi/file/queryByIdFile', {
    params,
  });
}

/**
 * 获取省市区
 * @param params
 */
export async function queryParamArea(params: { level?: number; parentId?: string | number }) {
  return request('/sealCuttingApi/area/queryParamArea', {
    params,
  });
}
